<% layout('/layouts/default.html', {title: '反馈任务详情', libs: ['layout', 'dataGrid']}){ %>
<div class="main-content">
    <div class="box box-main">
        <div class="box-header">
            <#form:form id="searchForm" model="${dcSupTaskInfo}" action="${ctx}/action/dcSupTaskAction/feedbackList" method="post" class="form-inline"
            data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
            <div style="float: right">
                <div class="form-group">
                    <label class="control-label">${text('任务年度')}：</label>
                    <div class="control-inline width-120">
                        <#form:select path="taskYear" items="${yearList}" blankOption="true" data-placeholder="请选择" itemLabel="yearLabel" itemValue="yearValue" class="form-control width-120"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">${text('任务标题')}：</label>
                    <div class="control-inline width-160">
                        <#form:input path="taskTitle" maxlength="200" class="form-control width-160" placeholder="请输入任务标题"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">${text('督办字号')}：</label>
                    <div class="control-inline width-120">
                        <#form:input path="messageNumber" maxlength="50" class="form-control width-120" placeholder="请输入督办字号"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">${text('任务类型')}：</label>
                    <div class="control-inline width-160">
                        <#form:select path="taskTypeCode" items="${dicts}" blankOption="true" data-placeholder="请选择任务类型" itemLabel="dictLabel" itemValue="dictValue" class="form-control width-160 " />
                    </div>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
                    <button onclick="cz();" class="btn btn-default btn-sm">${text('重置')}</button>
                    <button id="changeIcon" type="button" class="btn btn-default btn-sm btnFormMore">${text('高级查询')}<i class="fa fa-angle-double-down" id="changeIcon1"></i></button>

                    <!--                    <a href="#" class="btn btn-default" id="btnExport"><i class="glyphicon glyphicon-export"></i> ${text('导出')}</a>-->
                    <a href="#" class="btn btn-default loading1" id="btnExportWord"><i class="glyphicon glyphicon-export"></i> ${text('导出')}</a>
                </div>
                <div class="form-more">
                    <div style="float: right">
                            <div class="form-group">
                                <label class="control-label">${text('创建时间')}：</label>
                                <div class="control-inline">
                                    <#form:input path="createDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
                                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="createDate_lte.click()"/> -
                                    <#form:input path="createDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
                                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
                                </div>
                                <div class="control-inline" style="width:75px;">
                                    <select onchange="js.quickSelectDate(this.value, 'createDate_gte', 'createDate_lte');" class="form-control">
                                        <option value="0">&nbsp;</option><option value="1">${text('今日')}</option>
                                        <option value="2">${text('本周')}</option><option value="2|7">${text('上周')}</option>
                                        <option value="3">${text('本月')}</option><option value="4">${text('本季度')}</option>
                                        <option value="5">${text('上1个月')}</option><option value="5|3">${text('上3个月')}</option>
                                        <option value="1|7">${text('近1个周')}</option><option value="6">${text('近1个月')}</option>
                                        <option value="6|3">${text('近3个月')}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" title="">${text('督办科室')}：</label>
                                <div class="control-inline width-160">
                                    <#form:select path="taskSupOrg" dictType="dc_task_department"  blankOption="true" data-placeholder="请选择督办科室"  class="form-control width-120" />
                                    <#form:hidden path="taskSupOrgName" />
                                </div>
                            </div>
                        <div class="form-group">
                            <label class="control-label">${text('任务状态')}：</label>
                            <div class="control-inline width-160">
                                <% var taskitem = [{label:'未完成',value:'2'},{label:'已完成',value:'1'}]; %>
                                <#form:select path="taskProgressStr" items="${taskitem}"  itemLabel="label" itemValue="value" blankOption="true" data-placeholder="任务状态" class="form-control width-120"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label">${text('创建人')}：</label>
                            <div class="control-inline width-160">
                                <% var items = [{label:'本单位',value:'0'},{label:'本科室',value:'2'},{label:'我创建的',value:'1'}]; %>
                                <#form:select path="dataRange" items="${items}" blankOption="true" data-placeholder="任务创建人"  itemLabel="label" itemValue="value"  class="form-control width-160 " defaultValue="0" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </#form:form>
    </div>
    <div class="box-body">
        <table id="dataGrid"></table>
        <div id="dataGridPage"></div>
    </div>
</div>
</div>
<% } %>
<script>
    //重置
    function cz(){
        searchForm.reset();
        $('#dataGrid').dataGrid('reloadGrid');
    }

    $('#dataGrid').dataGrid({
        dataGridPage: $('#dataGridPage'),
        searchForm: $("#searchForm"),
        sortableColumn: false, // 列表不允许排序
        columnModel: [
            {header:'任务id',hidden: true, name:'id', width:150, align:"left"},
            // {header:'${text("任务年度")}', name:'taskYear', index:'a.task_year', width:80, align:"center"},
            {header:'${text("督办字号")}', name:'messageNumber', index:'a.message_number', width:100, align:"left"},
            {header:'${text("任务标题")}', name:'taskTitle', index:'a.task_title', width:150, align:"left"},
            {header:'任务内容', name:'taskContent', width:150, align:"left", formatter: function(val, obj, row, act){
                    return '<a href="${ctx}/taskdeploy/dcSupTaskInfo/detailForm?id='+row.id+'" class="btnList" data-title="${text("督办任务信息")}">'+(val||'暂无内容')+'</a>';
                }},
            {header:'任务类型', name:'taskTypeName', width:150, align:"left"},
            {header:'牵头责任单位', name:'taskLeaderOrgName',width:100, align:"left"},
            {header:'负责督办', name:'taskSupUserName',  width:80, align:"center",formatter:function (val,obj,row,act){
                    return formatTaskInfoValue(val)+formatTaskInfoValue(row.taskSupOrgName)
            }},
            {header:'完成时限', name:'taskEndTime', width:120, align:"center",
                formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'}},
            {header:'进展详情', name:'taskStatus',  width:150, align:"center", formatter: function(val, obj, row, act){
                    return js.getDictLabel(${@DictUtils.getDictListJson('dc_task_status')}, val, '未知', true);
                }},
            {header:'拟采取的工作举措', name:'arrange.arrangeContent3',  width:150, align:"left"},
            {header:'存在问题', name:'arrange.arrangeContent2',  width:150, align:"left"},
            {header:'最新进展情况', name:'arrange.arrangeContent', width:150, align:"left"},
            {header:'任务状态', name:'taskProgress', width:80, align:"center",formatter(val, obj, row, act){
                if (val ==null ||val==''){
                    return ''
                }
                return js.getDictLabel(${@DictUtils.getDictListJson('dc_task_arrange_status')}, val, '${text("")}', true);
            }},
        ],
        onSelectRow: function(id, isSelect, event){

        },
        ajaxSuccess: function(data){

        }
    });

    // 拼接负责督办
    function formatTaskInfoValue(val){
        if (typeof (val)!="undefined"){
            return '<p style="text-align: center;margin-top: 6px">'+val+'</p>'
        }
        return '<p style="text-align: center">&nbsp;</p>';
    }

    // 导出
    $('#btnExport').click(function(){
        js.ajaxSubmitForm($('#searchForm'), {
            url:'${ctx}/action/dcSupTaskAction/exportData',
            downloadFile:true
        });
    });
    // 导出word
    $('#btnExportWord').click(function(){
        js.ajaxSubmitForm($('#searchForm'), {
            url:'${ctx}/action/dcSupTaskAction/exportWord',
            downloadFile:true,

        });
    });
    //导出加载框
    $('.loading1').click(function(){
        js.loading("正在导出，请勿重复操作...");
        js.closeLoading(3000);
    })
</script>